package cn.ainit.sys.yzpe;

import java.util.List;
import java.util.Map;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;

@Service
public class YzpeServiceImpl implements YzpeService {
	
	private YzpeDao yzpeDao;
	
	@Resource
	public void setYzpeDao(YzpeDao yzpeDao) {
		this.yzpeDao = yzpeDao;
	}
	@Override
	public YzpeReturnObj calculate(YzpeReceiveObj receiveObj) throws Exception {
		return yzpeDao.calculate(receiveObj);
	}
	@Override
	public String newPiciFunc(String djId,
			List<Map<String, String>> allObjList,String uid) throws Exception {
		return this.yzpeDao.newPiciFunc(djId, allObjList,uid);
	}
	@Override
	public String judgePiciFunc(String peId, String uid, String dsId)
			throws Exception {
		return this.yzpeDao.judgePiciFunc(peId, uid, dsId);
	}
	
	@Override
	public String queryZRR(String xtid) {
		String sql ="select sru.user_id from sys_role_user sru left join sys_role sr on sru.role_id=sr.role_id where sr.role_id = '2E252E29F9B14C57AEF45ED65EC74CE9' and exists(select * from bs_flowmanager bf where bf.xt_id='"+xtid+"' and bf.flow_id='68442DCDF7B34568A4FB458412DC1071' and instr(bf.duty_man,sru.user_id) > 0) and sru.user_id not like '%id%' and rownum=1 ";
		
		String zrr=yzpeDao.queryZRR(sql);
		
		return zrr;
	}
}
